<template>
    <div class="content">
        <el-container>
            <el-header height="40px">
                <el-page-header @back="goBack" style="margin-top: 10px"></el-page-header>
            </el-header>
            <div style="width: 100%">
                <el-steps :active="active" finish-status="success" :space="500" align-center style="margin: auto">
                    <el-step title="店家注册"></el-step>
                    <el-step title="店铺申请"></el-step>
                    <el-step title="注册成功"></el-step>
                </el-steps>
            </div>
            <div v-if="active!==2" style="width: 500px; margin: 100px auto;">
                <router-view @func="getActive" @registerInfo="getRegisterInfo"/>
            </div>
            <div v-if="active===2">
            </div>
<!--            <el-footer></el-footer>-->
        </el-container>
    </div>
</template>
<script>
    import Toast from "vant/lib/toast";

    export default {
        name: "ShopManager",
        created(){
          this.$router.push("/shopManagerRegister")
        },

        data() {
            return {
                active:0,
                registerInfo:{
                    userInfo:null,
                    shopInfo:null
                },
            };
        },
        methods: {
            getActive(data){
                if(data===1){
                    this.active = data;
                }else if(data===2){
                    this.active = data;
                }

            },
            goBack() {
                this.$router.push("/registerType")
            },
            getRegisterInfo(data){
                this.registerInfo.userInfo = data.userInfo;
                this.registerInfo.shopInfo = data.shopInfo;
                console.log(this.registerInfo);
                this.axios.post("http://localhost:8084/shopManagerRegister",data)
                    .then(resp=>{
                    this.registerSuccess();
                });
            },

            registerSuccess() {
                this.$message({
                    message: '恭喜你，注册成功！！！',
                    type: 'success',
                    offset:300
                });
                setTimeout(()=>{
                    //注册成功，跳转到登陆界面
                    this.$router.push("/toManagerLogin");
                },3000);

            },
        }
    }
</script>
<style scoped>
.content {
  background: url(../../public/upload/img9.jpg) no-repeat;
  background-size: cover;
  /*width: 100vw;*/
  /*height: 100vh;*/
}
    .el-form{
        /*width: 300px;*/
        /*height: 200px;*/
        /*margin: 20px auto;*/
    }
/*.el-container {*/
/*  display: none;*/
/*}*/
    /*.el-container{*/
    /*    height: 800px;*/
    /*}*/
    .el-main {
        /*background-color: #fff;*/
        color: #333;
        text-align: center;
        /*line-height: 160px;*/
        /*height: 600px;*/
    }

    .el-header {
        /*background-color: #009be2;*/
        color: #333;
        text-align: center;
    }

    .el-footer{
        background-color: #B3C0D1;
        color: #333;
    }
.el-main::-webkit-scrollbar {
  display: none;
}

.el-container {
  height: 100vh;
  overflow: auto;
}
/deep/.el-form-item__label {
  color: black;
}

::-webkit-scrollbar {
  /* width: 0 !important;
  height: 0; */
display: none;
}
</style>
<style scoped>

</style>
